%\begin{annexos}

\setcounter{section}{0}

%\hypertarget{annex-gpl}{} \section{Llicència GPL} 

%\input{./GPL.tex}

\section{Compilació creuada de python}
\hypertarget{annex-cross-compile-python}{}Aquests són els passos detallats per a compilar l'entorn Python per a un dispositiu Andoird\cite{bib-cross-compiling-python}.

\paragraph{}
En primer lloc cal obtenir una versió ``hoste'' de l'entorn d'execució de Python. Això no hauria de tenir més complicació que la l'obtenir el codi font de Python i executar un simple ./configure; make; make install.

\paragraph{}
Després d'això cal aplicar el ``pedaç'' al codi font de Python (prèviament copiat en algun altre lloc per no modificar l'hoste). Aplicar el pedaç es fa naturalment amb l'eina ``patch'' (patch -p0 python-2.7.2.android.diff), i a continuació cal preparar l'Android NDK, i modificar algunes variables d'entorn:

\begin{lstlisting}
export ANDROID\_NDK=[PATH WHERE THE ANDROID NDK IS]
export PATH=``\$ANDROID\_NDK/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/:\$ANDROID\_NDK:\$ANDROID\_NDK/tools:/usr/local/bin:/usr/bin:/bin''
export ARCH=``armeabi''
export CFLAGS=``-DANDROID -mandroid -fomit-frame-pointer --sysroot \$ANDROID\_NDK/platforms/android-5/arch-arm''
export CXXFLAGS = ``\$CFLAGS''
export CC=``arm-linux-androideabi-gcc \$CFLAGS''
export CXX=``arm-linux-androideabi-g++ \$CXXFLAGS''
export AR=``arm-linux-androideabi-ar''
export RANLIB=``arm-linux-androideabi-ranlib''
export STRIP=``arm-linux-androideabi-strip --strip-unneeded''
export MAKE=``make -j4 HOSTPYTHON=[PATH TO HOST PYTHON] HOSTPGEN=[PATH TO HOST PGEN] CROSS\_COMPILE=arm-eabi- CROSS\_COMPILE\_TARGET=yes''
\end{lstlisting}

\paragraph{}
Naturalment posant a on cal les direccions cap a l'executable de python i el de pgen del host.

\paragraph{}
Després cal configurar la compilació creuada de la següent manera per fer servir el compilador per arm del NDK:

\begin{lstlisting}[language=bash]
./configure LDFLAGS=``-Wl,--allow-shlib-undefined'' CFLAGS=``-mandroid -fomit-frame-pointer --sysroot  \$ANDROID\_NDK/platforms/android-5/arch-arm'' HOSTPYTHON=[HOST PYTHON PATH] HOSTPGEN=[HOST PGEN PATH] --host=arm-eabi --build=i686-pc-linux-gnu --enable-shared --prefix=``[WHERE YOU WANT TO PUT THE GENERATED PYTHON STUFF]''
\end{lstlisting}

\paragraph{}
Però abans de fer servir el makefile generat cal fer-hi una petita modificació:

\begin{lstlisting}
sed -i "s|^INSTSONAME=\(.*.so\).*|INSTSONAME=\\1|g" Makefile
\end{lstlisting}

\paragraph{}
I ara si que s'hauria de poder compilar sense problema.

\cleardoublepage
\section{Mapsforge Binary MapFile}
\hypertarget{annex-map-file}{} 
%\input{./mapsforge-binary-map-file.tex}
\input{./SpecificationBinaryMapFile.tex}
Font: \url{http://code.google.com/p/mapsforge/wiki/SpecificationBinaryMapFile}

\cleardoublepage
\section{OpenStreetMap tile usage policy}
\hypertarget{annex-osm-tile-policy}{}We are in principle happy for our map tiles to be used by external users for creative and unexpected uses - in contrast to most web mapping providers, which insist that you use only their supplied API.

\par
If you see this image instead of the requested tile your application may be making unreasonable demands on OSM infrastructure.
However, OpenStreetMap's own servers are run entirely on donated resources. They have strictly limited capacity. Heavy use of OSM tiles adversely affects people's ability to edit the map, and is an abuse of the individual donations and sponsorship which provide hardware and bandwidth. As a result, we require that users of the tiles abide by this tile usage policy.

\par
OpenStreetMap data is free for everyone to use. Our tile servers are not.

\par
Below are the minimum requirements that users of tile.openstreetmap.org must adhere to. These may change in future, depending on available resources. Should any users or patterns of usage nevertheless cause problems to the service, access may still be blocked without prior notice. We will try to contact relevant parties if possible, but cannot guarantee this.

\par
But because OpenStreetMap data is free, many other organisations provide map tiles made from OSM data. If your project doesn't meet these requirements, you can get OSM-derived map tiles elsewhere.

\textbf{Requirements}

\begin{itemize}
        \item{}Heavy use (e.g. distributing an app that uses tiles from openstreetmap.org) is forbidden without prior permission from the System Administrators. See below for alternatives.
        \item{}Clearly display license attribution.
        \item{}Do not actively or passively encourage copyright infringement.
        \item{}Calls to /cgi-bin/export may only be triggered by direct end-user action. (For example: ''click here to export''.) The export call is an expensive (CPU+RAM) function to run and will frequently reject when server is under high load.
\end{itemize}

\textbf{Technical Usage Requirements}

\begin{itemize}
        \item{}Valid User-Agent identifying application. Faking another app's User-Agent WILL get you blocked.
        \item{}If known, a valid HTTP Referer.
        \item{}DO NOT send no-cache headers. (''Cache-Control: no-cache'', ''Pragma: no-cache'' etc)
        \item{}Cache Tile downloads locally according to HTTP Expiry Header, alternatively a minimum of 7 days.
        \item{}Maximum of 2 download threads. (Unmodified web browsers' download thread limits are acceptable.)
\end{itemize}
Note: modern web browsers in standard configuration generally pass all the above technical requirements.

\textbf{Bulk Downloading}

Bulk downloading is strongly discouraged. Do not download tiles unnecessarily.
In particular, downloading significant areas of tiles at zoom levels 17 and higher for offline or later usage is forbidden without prior consultation with a System Administrator. These tiles are generally not available (cached) on the server in advance, and have to be rendered specifically for those requests, putting an unjustified burden on the available resources.
To avoid having your access blocked, please discuss your requirement with system administrators either via their wiki pages or on the IRC channel prior to starting.

\textbf{Changes to this policy}

This policy may change at any time subject to the needs and constraints of the project. Commercial services, or those that seek donations, should be especially aware that access may be withdrawn at any point: you may no longer be able to serve your paying customers if access is withdrawn.

\textbf{Alternative OpenStreetMap Tile Providers}

Free tile servers based on OSM data:
\begin{itemize}
        \item{}MapQuest Open
        \item{}TMS - listing more
\end{itemize}
Paid-for tile servers:
\begin{itemize}
        \item{}See Commercial OSM Software and Services
\end{itemize}
Setting up your own tile server:
the switch2osm website, with up to date information on running your own OSM based services
\begin{itemize}
        \item{}Tiledrawer
        \item{}MapBox
\end{itemize}
This policy relates to the the default ''Mapnik'' tiles rendered and served by {a,b,c}.tile.openstreetmap.org as part of the OpenStreetMap project. It does not relate to other tiles that are viewable on the OpenStreetMap.org homepage, which may have their own usage policies. You should contact the individual projects, such as OpenCycleMap, if you wish to use their tiles.

\cleardoublepage
\section{Extracte dels ``issues'' de mapsforge}
\hypertarget{annex-mapsforge-issue-kml}{}Aquest és un extracte dels ``issues'' de mapsforge, on es plantejava l'implementació del suport a KML, i es descartava per manca de recursos:

\textbf{Project Member Reported by thilo.mu...@gmail.com, Jun 5, 2011}
\begin{quotation}
At the moment all overlay classes accept only ''raw'' coordinates, represented by the GeoPoint class. But in many cases the actual input data comes from a KML file which is stored somewhere on the device. Although parsing KML files is not a big deal in theory, it means that developers need to write the same code over and over again.

We should therefore extend the overlay interface so that developers can pass KML files directly to WayOverlays for example. Having one stable and correctly designed implementation will also reduce the risk of bugs in the client application.
\end{quotation}

\textbf{Sep 2, 2012 Project Member \#1 thilo.mu...@gmail.com}
\begin{quotation}
Due to our very limited resources we cannot implement this feature in the mapsforge-map library as there are also many more important issues that need to be fixed first.
\end{quotation}

Font: \url{http://code.google.com/p/mapsforge/issues/detail?id=121}

\cleardoublepage
\section{Extractes de la llista de correus de mapsforge-dev}
\hypertarget{annex-email-list-mapsforge}{} 

\subsection{Converses inicials}
\input{./mapsforge-dev-mails.tex}
Font: \url{https://groups.google.com/forum/?fromgroups=#!topic/mapsforge-dev/BL2AqAaC5nY/discussion}

\subsection{Converses per a la optimització de map-file writer}
\hypertarget{annex-email-list-mapsforge-2}{} 
\input{./mapsforge-dev-mails2.tex}
Font: \url{https://groups.google.com/forum/?fromgroups#!msg/mapsforge-dev/ioB0RO3zBNo/y7NlsRiQUZwJ}

\cleardoublepage
\section{Extractes de la llista de correus d'osmosis-dev}
\hypertarget{annex-email-list-osmosis}{} 
\input{./osmosis-dev-mails.tex}

\cleardoublepage
\section{Extractes de la llista de correus de jibx-dev}
\hypertarget{annex-email-list-jibx}{} 

\textbf{adria . ribatallada Thu, 14 Jun 2012 10:12:49 -0700}
\begin{quotation}
Hi All,

I was trying to generate bindings for kml2.2 using the standard  
schemas provided by ogc (\url{http://schemas.opengis.net/kml/2.2.0/}), but  
I'm stuck at the first step since the codeGen tool throws this  
''IllegalArgumentException'' exception.

Using google's previous schema codeGen was working good, and all  
seemed to work well  
(\url{https://developers.google.com/kml/schema/kml21.xsd}) but it's vital  
for me to use this new version of the kml schema, and I don't know  
what to do.

As you can imagine I don't have control over the schema since it's  
given as is, and I'm completely at a loss.

Anyone have a clue why there is a problem? I'm doing something wrong?  
is there something I can do to solve this?

I'v searched and found some cases of this exception in the mailing  
list, but it were related to empty enumeration values, and I don't  
think this is the concrete case here. Also most of that old messages  
apparently were solved in newer versions of jibx, so.

What should I do?

Also, there are a LOT of Warning: No type defined for element  
'something' at (line 1615, col 59, in ogckml22.xsd) but I don't think  
it's related to the IllegalArgumentException.


I write here because I don't know who else can help me solve this  
problem, any kind of advice will de helpful.

Thanks all in advance.

Greetings,

Adrià Ribatallada Torelló.



P.D. this is the exact output if it's of any help:
[..]
\end{quotation}


\textbf{Yosvany Wed, 03 Oct 2012 02:12:54 -0700}
\begin{quotation}
 \textless{}adria.ribatallada \textless{}at\textgreater{} est.fib.upc.edu\textgreater{} writes:

\textgreater{} 
\textgreater{} Hi All,
\textgreater{} 
\textgreater{} I was trying to generate bindings for kml2.2 using the standard  
\textgreater{} schemas provided by ogc (\url{http://schemas.opengis.net/kml/2.2.0/}), but  
\textgreater{} I'm stuck at the first step since the codeGen tool throws this  
\textgreater{} ''IllegalArgumentException'' exception.
\textgreater{} 

Hi all 

I'm getting this error working while trying to generate the code
using the travelport uAPI WSDLschema:  
\url{http://support.travelport.com/webhelp/uapi/Content/Resources/uAPI\_WSDLschema\_Release-3.1.0.88.zip and jibx_1.2.4}  (will try a previous version)

I'm using the codegen's build.xml from the examples directory 
just pointing to the other schema.


codegen:
     [echo] Running code generation from schema
     [java] Loaded and validated 1 specified schema(s) and 2 referenced 
schema(s)
     [java] Exception in thread ''main'' java.lang.IllegalArgumentException
     [java]     at 
org.eclipse.jdt.core.dom.SimpleName.setIdentifier(SimpleName.java:191)
     [java]     at org.eclipse.jdt.core.dom.AST.newSimpleName(AST.java:1303)
     ..... blabla (the same trace from the original post)

Any help with this guys?, i'm really new with all this stuff 
Thank you
\end{quotation}

\textbf{adria . ribatallada Fri, 08 Feb 2013 15:25:11 -0800}
\begin{quotation}
Hey, sorry to revive this old and long forgotten issue.

But I forgot to mention that recently, and using a rather rudimentary  
method, I had been able to isolate the schema part that was causing  
that IllegalArgumentException.

In the 2.1 version (which WASN'T causing any error) the problematic  
complexType looked like that:

\begin{lstlisting}[style=XML]
  <complexType name=``ItemIconType'' final=``\#all''>
     <complexContent>
       <extension base=``kml:ObjectType''>
         <sequence>
           <element name=``state'' type=``kml:itemIconStateType'' minOccurs=``0'' maxOccurs=``unbounded''/>
           <element name=``href'' type=``anyURI''/>
         </sequence>
       </extension>
     </complexContent>
   </complexType>
\end{lstlisting}

But in the 2.2 version of the schema this was changed so it looked like this:

\begin{lstlisting}[style=XML]
   <complexType name=``ItemIconType'' final=``\#all''>
     <complexContent>
       <extension base=``kml:AbstractObjectType''>
         <sequence>
           <element ref=``kml:state'' minOccurs=``0''/>
           <element ref=``kml:href'' minOccurs=``0''/>
           <element ref=``kml:ItemIconSimpleExtensionGroup'' minOccurs=``0''
             maxOccurs=``unbounded''/>
           <element ref=``kml:ItemIconObjectExtensionGroup'' minOccurs=``0''
             maxOccurs=``unbounded''/>
         </sequence>
       </extension>
     </complexContent>
   </complexType>
\end{lstlisting}

And then previously, the conflicting element was defined:

\begin{lstlisting}[style=XML]
   <element name=``state'' type=``kml:itemIconStateType''/>
\end{lstlisting}

With a bunch of other elements.

Well then, this state element was causing the trouble. I don't know  
why (I guess it has to do with the minOccurs/maxOccurs attribute?), or  
if there was a better way to avoid that exception (like a  
configuration parameter, or something) but after manually editing the  
schema and reverting this concrete object, the code (and the bindings)  
are created.

Maybe someone reading this can correct the ``bug'' in the codeGen, or  
treat that exception nicely so the user can understand what's going on.

I will welcome any further explanation on the matter, too.

Kind Regards.

Adrià Ribatallada i Torelló.

Quoting adria.ribatall...@est.fib.upc.edu:

\textgreater{} Hi All,
[...]
\textgreater{}       at org.jibx.schema.codegen.CodeGen.main(CodeGen.java:2206)
\end{quotation}

Font: \url{http://www.mail-archive.com/jibx-users@lists.sourceforge.net/msg04861.html}

\cleardoublepage
\section{Manual d'utilització d'erdapfel}
\hypertarget{annex-user-man-erdapfel}{} 
\input{./UserGuide.tex}

\cleardoublepage
\section{Exemple de fitxer GML}
\hypertarget{annex-gml-file}{} 
\input{./GMLSample.tex}

\cleardoublepage
\section{Exemple de fitxer KML}
\hypertarget{annex-kml-file}{} 
\input{./KMLSample.tex}

%\end{annexos}
